package com.kasax.skin;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.os.Environment;
import android.view.View;

import com.kasax.skin.support.SkinManager;
import com.kasax.skin.support.utils.FileUtils;

import java.util.ArrayList;
import java.util.List;

public class CustomSkinActivity extends AppCompatActivity {

    /**
     * 从服务器拉取的皮肤表
     */
    private List<Skin> skins = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_custom_skin);

        setTitle("修改化换肤");

        // 用于模拟服务器下载
        skins.add(new Skin("85f25f735c32d2515244c12122ed6fea", "test.skin", "app_skin-debug.apk"));
    }

    public void handleChangeSkin(View view) {
        String skinFilePath = FileUtils.getSafeSdcardPath("app_skin-debug.apk");
        SkinManager.getInstance().loadSkin(skinFilePath);
    }

    public void handleRestoreSkin(View view) {
    }

    public void handleChangeDayMode(View view) {
    }

    public void handleSelector(View view) {
    }

    public void handleLightMode(View view) {
    }
}